Backport test fixes to 4.0.x#3005
Merged
Merged
Conversation
The Dir created by `Dir.new(Dir.pwd).fileno` was only referenced long enough to read its fileno, so it became collectable immediately. When GC ran between the assert_send_type calls the fd was closed, making the later `Dir.fchdir(fd)` fail with Errno::EBADF. Keep the Dir in a local and close it in ensure. Surfaced on ruby/ruby ZJIT CI with --enable-zjit=dev --zjit-call-threshold=1. https://github.com/ruby/ruby/actions/runs/27735384476/job/82051097840 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
test_for_fd has the same pattern as test_fchdir: the Dir from `Dir.new(Dir.pwd).fileno` is collectable before `Dir.for_fd(fd)` runs, so an ill-timed GC closes the fd and the call fails with Errno::EBADF. Keep the Dir alive in a local and close it in ensure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Released bundlers (up to 4.0.11) reference Pathname::SEPARATOR_PAT, which became a private constant on ruby-head, causing bundle install to crash with NameError. The fix (ruby/rubygems#9529) is on master but not yet released. Use bundler's "version system" config to skip the lockfile-pinned 4.0.1 and use ruby-head's bundled bundler instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport test fixes needed for the 4.0.x release branch.
Original PRs:
Changes
Zlib::GzipReader.wrap.DirSingletonTest#test_fchdirandDirSingletonTest#test_for_fdrobust against aggressive GC.Testing
Not run locally. This will be tested in CI.